@page "/Admin/Settings"

@using BlazorAdmin.Models
@using BlazorAdmin.Web.Shared.Components
@using BlazorAdmin.Web.Shared.Models

<AdminTable TItem=Setting CustomerSearchModel=TableSearchModel
            OnQueryAsync="OnQueryAsync" OnSaveAsync="OnSaveAsync" OnDeleteAsync="OnDeleteAsync">
    <TableColumns>
        <TableColumn @bind-Field="context.Code" Filterable="true" Sortable="true" Width=142 />
        <TableColumn @bind-Field="context.Description" Filterable="true" Sortable="true" />
        <TableColumn @bind-Field="context.Value" Filterable="true" Sortable="true" />
        <TableColumn @bind-Field="context.IsEnable" Filterable="true" Sortable="true" Width=114 />
        <TableColumn @bind-Field="context.IsReadOnly" Filterable="true" Sortable="true" Width=114 />
        <TableColumn @bind-Field="context.Updater" Filterable="true" Sortable="true" Width=100 />
        <TableColumn @bind-Field="context.UpdateTime" Filterable="true" Sortable="true" Width=148 FormatString=@SysConsts.FormatTime/>
    </TableColumns>
    <EditTemplate>
        <SettingsEdit @bind-Value="context" />
    </EditTemplate>
    <CustomerSearchTemplate>
        @if (context is SettingsSearchModel v)
        {
            <SettingsSearch @bind-Value="v" />
        }
    </CustomerSearchTemplate>
</AdminTable>